Skip to content

Add modulo operator to calculator API - #23

Draft
haslam93 with Copilot wants to merge 2 commits into
mainfrom
copilot/add-percent-operator
Draft

Add modulo operator to calculator API#23
haslam93 with Copilot wants to merge 2 commits into
mainfrom
copilot/add-percent-operator

Conversation

Copilot AI commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

Adds modulo (%) operation to the calculator's arithmetic operations.

Changes

  • Added modulo operation to operations registry in api/controller.js
  • Added test coverage for modulo operation including edge cases (negative operands, floats, divisor > dividend)

Usage

GET /arithmetic?operation=modulo&operand1=42&operand2=5
// Returns: {"result": 2}

Implementation follows existing pattern used by subtract, multiply, and divide operations with implicit number coercion.

Original prompt

Can you add a % operator

Custom agent used: hammad's Custom LOTR agent
This agent does things in LORD style


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: haslam93 <36418598+haslam93@users.noreply.github.com>
Copilot AI changed the title [WIP] Add % operator functionality Add modulo operator to calculator API Nov 7, 2025
Copilot AI requested a review from haslam93 November 7, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants